package cn.caskm.souvenirshopsystem.controller.api;

import cn.caskm.souvenirshopsystem.domain.Result;
import cn.caskm.souvenirshopsystem.domain.po.SysBanner;
import cn.caskm.souvenirshopsystem.service.SysBannerService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/banner")
@RequiredArgsConstructor
public class BannerController {

    private final SysBannerService bannerService;

    @GetMapping("/getAll")
    public Result<List<SysBanner>> getAll() {
        List<SysBanner> list = bannerService.lambdaQuery()
                .eq(SysBanner::getStatus, "0")
                .list();
        return Result.success(list);
    }

}
